package mapengine.building
{
import flash.display.MovieClip;
import flash.geom.Point;

import isoengine.interfaces.IMapObjectData;
import isoengine.interfaces.IMapSprite;
import isoengine.values.MapSkillRangeList;

import mapengine.interfaces.IMapStaticObject;

import values.map.MapObjectValue;

/**
 * MapStaticObject
 * @author jliang
 *
 */
public class MapStaticObject extends MapObjectBase implements IMapStaticObject
{
	//==========================================================================
	//  Constructor
	//==========================================================================
	public function MapStaticObject(descriptor:Object=null)
	{
		super(descriptor);
		
	}
	
	protected var vo:MapObjectValue;
	
	public function get staticValue():MapObjectValue
	{
		return vo;
	}
	
	override public function set objectData(value:IMapObjectData):void
	{
		super.objectData = value;
		
		vo = objectData as MapObjectValue;
	}
	
	override public function initialize():void
	{
		var classRef:Class = vo.objectClassRef;
		var mc:MovieClip = new classRef() as MovieClip;
		initAsset(mc);		
	}
	
	override public function clickFun():void
	{
		super.clickFun();
		
		//测试用
		isoWorld.dragSprite(this, dropTestHandler);
		//isoWorld.rangeOnDistance(new Point(objectData.x, objectData.y), 4, true);
		//rendOff();
	}
	
	/**
	 * isoWorld.dragSprite 的回调函数
	 * @param _isoMapSprite 可选参数，回传IMapSprite，本参数也可不填
	 */
	private function dropTestHandler(_isoMapSprite:IMapSprite):void
	{
		trace(_isoMapSprite);
	}
	
}
}


